package com.caojing.syby.ui.brandsale.brandchildfragment;

import android.widget.Toast;

import com.caojing.syby.bean.brand.BrandBean;
import com.caojing.syby.httputils.HttpUtils;

import java.util.HashMap;

/**
 * Created by My on 2016/10/6.
 */
public class BrandChildPresenter implements BrandChildContract.Presenter {

    private BrandChildContract.Model model;
    private BrandChildContract.View view;

    public BrandChildPresenter(BrandChildContract.View view){
        this.view=view;
        this.model=new BrandChildModel();
    }

    @Override
    public void initBrandData(HashMap<String, String> params) {
        model.getBrandChildSuccess(params, new HttpUtils.HttpCallBack<BrandBean>() {
            @Override
            public void onSucess(BrandBean brandBean) {
                view.onBrandDataSuccess(brandBean);
            }

            @Override
            public void onFail() {
                view.onBrandDataFail("访问网络出错");
            }
        });
    }
}
